Calendar: Add default case to appease Coverity
authorDaniel Boles <dboles@src.gnome.org>
Tue, 1 Aug 2017 18:42:17 +0000 (19:42 +0100)
committerDaniel Boles <dboles@src.gnome.org>
Tue, 1 Aug 2017 19:15:14 +0000 (20:15 +0100)
CID 1432024 (#1 of 1): Uninitialized scalar variable (UNINIT)
2. uninit_use_in_call: Using uninitialized value rect.x when calling
calendar_arrow_rectangle.

Add a default case to the switch which will bail out with
g_assert_not_reached(), which should reassure Coverity that the method
is always called with a valid value that is handled in the switch.

gtk/gtkcalendar.c

index b9b55ddc042045a674eda11e531f6fb9c8b67729..e2f2ae6536c31accd1098c1a7789273479fdc4d1 100644 (file)
@@ -1224,6 +1224,9 @@ calendar_arrow_rectangle (GtkCalendar  *calendar,
         rect->x = (width - padding.left - padding.right
                    - 3 - priv->arrow_width);
       break;
+
+    default:
+      g_assert_not_reached();
     }
 
   rect->x += padding.left;